package com.autonavi.yunda.yunji.common.thread;

import lombok.Data;

/**
 * @author cizhong.wcs
 * @date 2022/6/21 14:20
 */
@Data
public class ThreadPoolInfo {
    private String label;
    private int activeCount;
    private int corePoolSize;
    private int maxPoolSize;
    private int poolSize;
    private String threadGroupName;
    private int queueRemainingCapacity;
    private int queueSize;
    private int totalTasks;
    private double averageTaskTime;

    @Override
    public String toString() {
        return "ThreadPoolInfo [label=" + label + ", 正在执行任务的线程数量=" + activeCount + ", corePoolSize=" + corePoolSize
                + ", maxPoolSize=" + maxPoolSize + ", 线程池当前的线程数量=" + poolSize + ", threadGroupName=" + threadGroupName
                + ", 队列剩余数量=" + queueRemainingCapacity
                + ", 队列使用数量=" + queueSize
                + ", 执行任务总数量=" + totalTasks
                + ", 近期执行任务平均时间(ms)=" + averageTaskTime
                + "]";
    }
}
